//
//  HZMHotPageCVC.m
//  糖糖大魔王
//
//  Created by 韩震明 on 15/11/2.
//  Copyright © 2015年 韩震明. All rights reserved.
//

#import "HZMHotPageCVC.h"

@implementation HZMHotPageCVC

- (void)dealloc
{
    [_nameLabel release];
    [_picImageView release];
    [_priceLabel release];
    [_favoriteLabel release];
    [_favoriteImageView release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

- (void)createCell
{
    self.picImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 2 * self.contentView.frame.size.height / 3)];
    [self.contentView addSubview:self.picImageView];
    [_picImageView release];
    
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 2 * self.contentView.frame.size.height / 3, self.contentView.frame.size.width, 2 * self.contentView.frame.size.height / 9)];
    [self.contentView addSubview:self.nameLabel];
    [_nameLabel release];
//    self.nameLabel.font = [UIFont systemFontOfSize:13.0];
    self.nameLabel.numberOfLines = 2;
    
    self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.contentView.frame.size.width / 140, 8 * self.contentView.frame.size.height / 9, self.contentView.frame.size.width / 2, self.contentView.frame.size.height / 9)];
    [self.contentView addSubview:self.priceLabel];
    [_priceLabel release];
    self.priceLabel.textColor = [UIColor redColor];
    self.priceLabel.font = [UIFont systemFontOfSize:13.0];
    
    self.favoriteImageView = [[UIImageView alloc] initWithFrame:CGRectMake(11 * self.contentView.frame.size.width / 16, 33 * self.contentView.frame.size.height / 36, self.contentView.frame.size.width / 16,1 * self.contentView.frame.size.height / 18)];
    [self.contentView addSubview:self.favoriteImageView];
    [_favoriteImageView release];
    self.favoriteImageView.image = [UIImage imageNamed:@"No_Attention.png"];
    
    self.favoriteLabel = [[UILabel alloc] initWithFrame:CGRectMake(6 * self.contentView.frame.size.width / 8, 8 * self.contentView.frame.size.height / 9, self.contentView.frame.size.width / 4, self.contentView.frame.size.height / 9)];
    [self.contentView addSubview:self.favoriteLabel];
    [_favoriteLabel release];
    self.favoriteLabel.font = [UIFont systemFontOfSize:13.0];
}

@end








